/*
 * @Author      : ZhouQiJun
 * @Date        : 2025-08-09 16:14:29
 * @LastEditors : ZhouQiJun
 * @LastEditTime: 2025-08-09 18:21:31
 * @Description : 设置底图
 */
import { type GisKey, KEY, Platform } from '@ol/define'
import { olSetBaseLayer } from '@ol/platform'
import type { ILayerOptions } from '@ol/types'

export default function setupBaseLayer(
  layerOptions: ILayerOptions,
  key: GisKey = KEY,
  platform: Platform = Platform.OL,
) {
  if (platform === Platform.CE) {
    return Promise.resolve(null)
  }
  return olSetBaseLayer(layerOptions, key)
}
